function [tipodefiltro orden notch wp qp g wz]=parseTransferencia(H)
%{
tipodefiltro:
pasabajos 1
pasaaltos 2
pasabanda 3
rechazabanda 4

notch:
si 1
no 0
%}

notch=0;

[num den]=tfdata(H);
num=cell2mat(num);
den=cell2mat(den);

if length(den)~=3
    orden=1;
    wp=den(2)/den(1);
    qp=1/2;
    if num(1)==0
        tipodefiltro=1;
        wz=[];
    else
        tipodefiltro=2;
        wz=0;
    end
    
else
    orden=2;
    
    wp=sqrt(den(3)/den(1));
    qp=den(3)/(den(2)*wp);
    
    if num(1)==0 && num(2)==0
        tipodefiltro=1;
        wz=[];
    else
    if num(2)~=0
        tipodefiltro=3;
        wz=0;
    else
        if num(3)==0
            tipodefiltro=2;
            wz=0;
        else
            notch=1;
            wz=sqrt(num(3)/num(1));
            
            if abs(wp-wz)<abs(wp/100)
                
                tipodefiltro=4;
            else
            if wz<wp
                tipodefiltro=2;
            
            else
                
                tipodefiltro=1;
            end
            end
        
        end
    end
    end   
end

switch tipodefiltro
    case 1
        g=bode(H,wp/(1e10));
    case 2
        g=bode(H,wp*1e10);
    case 3
        [MAG PHASE W]=bode(H);
        %W=cell2mat(W);
        W=squeeze(W);
        mag=bode(H,logspace(log10(W(1)),log10(W(end)),10000));
        g=max(mag);
    case 4
        g=bode(H,wp*1e10);
end
        
  

end